<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>刷题练习 - 环境监测实验</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { 
            font-family: Arial, sans-serif; 
            background: #f5f6fa; 
            padding: 15px; 
            color: #333; 
        }
        .header {
            background: white;
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin-bottom: 20px;
            text-align: center;
        }
        .header h1 { color: #2c3e50; margin-bottom: 10px; }
        .question {
            background: white;
            margin-bottom: 15px;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 3px 10px rgba(0,0,0,0.1);
        }
        .question-text {
            font-weight: bold;
            margin-bottom: 15px;
            font-size: 1.1rem;
        }
        .options { margin: 15px 0; }
        .option {
            display: block;
            margin: 10px 0;
            padding: 12px 15px;
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 10px;
            cursor: pointer;
        }
        .option input { margin-right: 10px; }
        .blank-input {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
            margin: 10px 0;
        }
        .judge-options {
            display: flex;
            gap: 10px;
            margin: 15px 0;
        }
        .judge-btn {
            flex: 1;
            padding: 15px;
            text-align: center;
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 10px;
            cursor: pointer;
            font-weight: bold;
        }
        .submit-btn {
            display: block;
            width: 100%;
            padding: 18px;
            background: linear-gradient(135deg, #27ae60, #2ecc71);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1.2rem;
            font-weight: bold;
            cursor: pointer;
            margin: 20px 0;
        }
        .result {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin-top: 20px;
            display: none;
        }
        .correct { color: #27ae60; background: #d5f4e6; padding: 10px; border-radius: 8px; margin: 8px 0; }
        .wrong { color: #e74c3c; background: #fadbd8; padding: 10px; border-radius: 8px; margin: 8px 0; }
        .score {
            text-align: center;
            font-size: 1.5rem;
            font-weight: bold;
            margin: 20px 0;
            padding: 20px;
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            border-radius: 12px;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>🧪 环境监测实验刷题</h1>
        <div>选择题、填空题、判断题练习</div>
    </div>

    <div id="quizContainer">
        <div class="question">
            <div class="question-text">1. 测定废水悬浮物时，应选用的滤膜孔径为（ ）</div>
            <div class="options">
                <label class="option"><input type="radio" name="q1" value="A"> A. 0.22μm</label>
                <label class="option"><input type="radio" name="q1" value="B"> B. 0.45μm</label>
                <label class="option"><input type="radio" name="q1" value="C"> C. 1.0μm</label>
                <label class="option"><input type="radio" name="q1" value="D"> D. 2.0μm</label>
            </div>
        </div>

        <div class="question">
            <div class="question-text">2. 悬浮物测定中，水样过滤后需用蒸馏水洗涤残渣______次</div>
            <input type="text" class="blank-input" placeholder="请输入答案">
        </div>

        <div class="question">
            <div class="question-text">3. 测定悬浮物时，可用中速定性滤纸代替定量滤膜，不影响结果准确性。（ ）</div>
            <div class="judge-options">
                <div class="judge-btn" onclick="selectJudge(this, 'q3', true)">✅ 正确</div>
                <div class="judge-btn" onclick="selectJudge(this, 'q3', false)">❌ 错误</div>
            </div>
        </div>
    </div>

    <button class="submit-btn" onclick="checkAnswers()">提交答案</button>

    <div id="result" class="result"></div>

    <script>
        function selectJudge(btn, name, value) {
            // 移除其他按钮的active状态
            const buttons = btn.parentElement.querySelectorAll('.judge-btn');
            buttons.forEach(b => b.classList.remove('active'));
            // 添加当前按钮的active状态
            btn.classList.add('active');
            // 设置值
            btn.setAttribute('data-value', value);
        }

        function checkAnswers() {
            const resultDiv = document.getElementById('result');
            let score = 0;
            let total = 3;
            
            resultDiv.innerHTML = '';
            
            // 检查第一题
            const q1Answer = document.querySelector('input[name="q1"]:checked');
            if (q1Answer && q1Answer.value === 'B') {
                score++;
                resultDiv.innerHTML += '<div class="correct">第1题 ✅ 正确！答案：B. 0.45μm</div>';
            } else {
                resultDiv.innerHTML += '<div class="wrong">第1题 ❌ 错误！正确答案：B. 0.45μm</div>';
            }
            
            // 检查第二题
            const q2Answer = document.querySelector('.blank-input').value.trim();
            if (q2Answer === '3~5' || q2Answer === '3-5') {
                score++;
                resultDiv.innerHTML += '<div class="correct">第2题 ✅ 正确！答案：3~5次</div>';
            } else {
                resultDiv.innerHTML += '<div class="wrong">第2题 ❌ 错误！正确答案：3~5次</div>';
            }
            
            // 检查第三题
            const q3Btn = document.querySelector('.judge-btn.active');
            if (q3Btn && q3Btn.getAttribute('data-value') === 'false') {
                score++;
                resultDiv.innerHTML += '<div class="correct">第3题 ✅ 正确！答案：错误</div>';
            } else {
                resultDiv.innerHTML += '<div class="wrong">第3题 ❌ 错误！正确答案：错误</div>';
            }
            
            // 显示总分
            resultDiv.innerHTML += `<div class="score">得分：${score} / ${total}</div>`;
            resultDiv.style.display = 'block';
        }
    </script>
</body>
</html>